import { buildService } from '../../helper/service'

// 值类型为String或Object,String为url(method),Object同axios(config)参数支持相同,data和params只能为对象类型
const settings = {
  // 构件列表
  getMemberList: {
    url: '/api/v1/project/component',
    method: 'get'
  },
  // 构件模板下载
  getMemberDownload: {
    url: '/api/v1/project/component_template',
    method: 'get'
  },
  // 获取楼号
  getBuildNum: {
    url: '/api/v1/project/component_build_no',
    method: 'get'
  },
  // 获取层号
  getFloorNum: {
    url: '/api/v1/project/component_floor_no',
    method: 'post'
  },
  // 构件删除
  deleteMember: {
    url: '/api/v1/project/component',
    method: 'delete'
  },
  // 导入构件
  uploadModel: {
    url: '/api/v1/project/component_import',
    method: 'post'
  },
  // 扫描构件二维码--构件详情
  getCodeInfo: {
    url: '/api/v1/project/code_component',
    method: 'get',
    type: 'restful'
  },
  // 构件导出
  exportMember: {
    url: '/api/v1/project/component_export',
    method: 'post',
    responseType: 'blob'
  }
}

export default buildService(settings)
